﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Control_DB_Railway.Views
{
    /// <summary>
    /// Логика взаимодействия для DataGrid_TypeStation.xaml
    /// </summary>
    public partial class DataGrid_Station : Window
    {
        Entities entities = new Entities();

        public DataGrid_Station()
        {
            InitializeComponent();

            // Передача данных из сущности
            var query_ = from station in entities.Stations
                         select new
                         {
                             station.stationID,
                             station.nameStation,
                             station.location,
                             station.overheadTransition,
                             station.image
                         };

            // Передача данных в DataGrid
            foreach (var item in query_)
                dataGrid_Stations.Items.Add(item);
        }
    }
}
